public class 冒泡排序 {
    public static void main(String[] args) {
        int[] nums = {16,25,9,90,23,100,17};
        System.out.println("+++++++冒泡排序前+++++++++");
        for(int num:nums){
            System.out.println(num);
        }
        //冒泡排序（升序）
        for (int i=0;i<nums.length-1;i++){
            for(int j=0;j<nums.length-1-i;j++){
                if(nums[j]>nums[j+1]){
                    int temp=nums[j];
                    nums[j]=nums[j+1];
                    nums[j+1]=temp;
                }
            }
        }
        System.out.println("++++++++++冒泡排序后+++++++++");
        for(int num:nums){
            System.out.println(num);
        }
    }
}
